to_bytes
Convert this big_integer
to a byte array.
The first bit of the generated byte array represents the sign (two's complement), and for subsequent bits, more significant bits are on the left and less significant bits are on the left (big-endian).
Inverse of big_integer.from_bytes()
.
Examples:
0L.to_bytes()
returnsx'00'
(-1L).to_bytes()
returnsx'FF'
1L.to_bytes()
returnsx'01'
2L.pow(100).to_bytes()
returnsx'10000000000000000000000000'
Since
0.12.0